package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Pwdrwrcm type
*/
@SuppressWarnings("ALL")
public class Pwdrwrcm {


        private static volatile Pwdrwrcm instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Pwdrwrcm getInstance() {
            if (instance == null) {
                synchronized (Pwdrwrcm.class) {
                    if (instance == null) {
                        instance = new Pwdrwrcm();
                    }
                }
            }
            return instance;
        }


        private Pwdrwrcm() {

        }



    public  Boolean judgeMexvljfzat(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeRvowwddjsr(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeOcgjuwwsxv(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeUtsdjryodn(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeKcbgpfvjtu(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeQuyevojvjs(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeGdkhtwwpup(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeArstzsuthi(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeVcionuzgdf(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeIccuocqgqo(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeCpquyonrky(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeEqscxqullh(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  mexvljfzat;
    private String  rvowwddjsr;
    private String  ocgjuwwsxv;
    private String  utsdjryodn;
    private String  kcbgpfvjtu;
    private String  quyevojvjs;
    private String  gdkhtwwpup;
    private String  arstzsuthi;
    private String  vcionuzgdf;
    private String  iccuocqgqo;
    private String  cpquyonrky;
    private String  eqscxqullh;


    public void setMexvljfzat(String mexvljfzat){
    this.mexvljfzat = mexvljfzat;
    }

    public String getMexvljfzat(){
    return this.mexvljfzat;
    }
    public void setRvowwddjsr(String rvowwddjsr){
    this.rvowwddjsr = rvowwddjsr;
    }

    public String getRvowwddjsr(){
    return this.rvowwddjsr;
    }
    public void setOcgjuwwsxv(String ocgjuwwsxv){
    this.ocgjuwwsxv = ocgjuwwsxv;
    }

    public String getOcgjuwwsxv(){
    return this.ocgjuwwsxv;
    }
    public void setUtsdjryodn(String utsdjryodn){
    this.utsdjryodn = utsdjryodn;
    }

    public String getUtsdjryodn(){
    return this.utsdjryodn;
    }
    public void setKcbgpfvjtu(String kcbgpfvjtu){
    this.kcbgpfvjtu = kcbgpfvjtu;
    }

    public String getKcbgpfvjtu(){
    return this.kcbgpfvjtu;
    }
    public void setQuyevojvjs(String quyevojvjs){
    this.quyevojvjs = quyevojvjs;
    }

    public String getQuyevojvjs(){
    return this.quyevojvjs;
    }
    public void setGdkhtwwpup(String gdkhtwwpup){
    this.gdkhtwwpup = gdkhtwwpup;
    }

    public String getGdkhtwwpup(){
    return this.gdkhtwwpup;
    }
    public void setArstzsuthi(String arstzsuthi){
    this.arstzsuthi = arstzsuthi;
    }

    public String getArstzsuthi(){
    return this.arstzsuthi;
    }
    public void setVcionuzgdf(String vcionuzgdf){
    this.vcionuzgdf = vcionuzgdf;
    }

    public String getVcionuzgdf(){
    return this.vcionuzgdf;
    }
    public void setIccuocqgqo(String iccuocqgqo){
    this.iccuocqgqo = iccuocqgqo;
    }

    public String getIccuocqgqo(){
    return this.iccuocqgqo;
    }
    public void setCpquyonrky(String cpquyonrky){
    this.cpquyonrky = cpquyonrky;
    }

    public String getCpquyonrky(){
    return this.cpquyonrky;
    }
    public void setEqscxqullh(String eqscxqullh){
    this.eqscxqullh = eqscxqullh;
    }

    public String getEqscxqullh(){
    return this.eqscxqullh;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}